package Test.Learn;

import java.net.*;
import java.io.*;
public class Client {
    public static void main(String[] args) throws IOException {
        Socket sk=new Socket("127.0.0.1",12345);

        InputStream in=sk.getInputStream();
        OutputStream out=sk.getOutputStream();
        InputStreamReader ir=new InputStreamReader(in);
        OutputStreamWriter iw=new OutputStreamWriter(out);
        BufferedReader br=new BufferedReader(ir);
        BufferedWriter bw=new BufferedWriter(iw);

        bw.write("Peter");
        bw.newLine();
        bw.flush();

        String s=br.readLine();
        System.out.println(s);

        sk.close();
    }
}
